How can I merge two dictionaries in Python to achieve a specific output format